<template>
    <footer class="bottom-nav">
      <div class="nav-item" @click="navigateTo('/homepage')">
        <img src="/src/assets/images/start-page/xtb1.png" alt="首页图标" />
        <span>首页</span>
      </div>
      <div class="nav-item" @click="navigateTo('/map')">
        <img src="/src/assets/images/start-page/xtb2.png" alt="地图图标" />
        <span>地图</span>
      </div>
      <div class="nav-item" @click="navigateTo('/scan')" style="margin: 0;">
        <img src="/src/assets/images/start-page/xtb3.png" alt="扫描图标" />
        <span>扫描</span>
      </div>
      <div class="nav-item" @click="navigateTo('/news')">
        <img src="/src/assets/images/start-page/xtb4.png" alt="新闻图标" />
        <span>新闻</span>
      </div>
      <div class="nav-item" @click="navigateTo('/my')">
        <img src="/src/assets/images/start-page/xtb5.png" alt="我的图标" />
        <span>我的</span>
      </div>
    </footer>
  </template>
  
  <script>
  export default {
    methods: {
      navigateTo(path) {
        this.$router.push(path); // 执行路由跳转
      }
    }
  };
  </script>
  
  <style scoped>
  .bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: space-around;
    background: linear-gradient(to top, rgba(144, 238, 144, 0.8), rgba(255, 255, 255, 0)); /* 渐变绿色 */
    padding: 6px 0; /* 统一为6px */
    backdrop-filter: blur(10px); /* 添加模糊效果 */
    box-shadow: 0px -2px 5px rgba(0, 0, 0, 0.1); /* 可选：添加阴影 */
  }
  
  .nav-item {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    font-size: 10px; /* 字体大小 */
    color: #333;
  }
  
  .nav-item img {
    width: 20px; /* 图标宽度 */
    height: 20px; /* 图标高度 */
    margin-bottom: 0px; /* 图标与文字的间距 */
  }
  
  .nav-item span {
    line-height: 1.2; /* 文字行高 */
  }
  
  .nav-item:hover {
    color: #007bff;
  }
  
  /* 确保扫描按钮位于中间 */
  .nav-item:nth-child(3) {
    margin: 0;
  }
  </style>
  